// .txt

beginzonescript;

variables;

short im_hostile = 0;
short last_abil;
short counter1 = 0;
short counter2 = 0;
short counter3 = 0;
short set_ter1 = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

//	set_name(,"");

	set_attack_range(30002,5);

	set_level(821,4);
	set_boss_level(821,1);

	set_name(829,"Ro Raider");
	set_name(30006,"Ro Raider");
	set_name(30007,"Ro Raider");

	set_name(824,"Ice Wolf");
	set_coloradj(824,4);
	change_max_health(824,15);
	add_ability(824,10,66,0);
	set_name(825,"Ice Wolf");
	set_coloradj(825,4);
	change_max_health(825,15);
	add_ability(825,10,66,0);
	
	set_attack_range(850,3);
	set_attack_range(851,3);
	set_attack_range(853,3);
	
//	add_ability(short which_char_or_group,short which_slot,short which_ability,0);

	if (is_town_clear(ME) == FALSE)
		erase_char(30010);
		
	if (gf(0,11) > 0)
		sf(8,20,1);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if ((gf(8,13) == 0) && (is_talking() == FALSE) && (party_has_item_equip(36))) {
		sf(8,13,1);
		sf(88,1,2);
		begin_talk_mode(13);
		}
	if ((gf(8,14) == 1) && (is_talking() == FALSE) && (is_combat()) && (gf(88,4) < 2)) {
		sf(8,14,2);
		counter3 = 0;
		revive_party();
		assert_hint(4);
		end();
		}
	if ((gf(8,14) > 0) && (is_talking() == FALSE) && (is_combat() == FALSE) && (gf(8,15) == 0)) {
		sf(8,15,1);
		begin_talk_mode(16);
		}
	if ((gf(8,16) == 1) && (is_talking() == FALSE) && (is_combat() == FALSE)) {
		sf(8,16,2);
		begin_talk_mode(17);
		}
	if ((gf(8,4) > 0) && (gf(8,17) == 0) && (is_talking() == FALSE) && (is_combat()) && (gf(88,10) < 2)) {
		sf(8,17,1);
		assert_hint(10);
		}
		
	// sutter
	if (on_which_layer() == 0)  {
		if (gf(8,18) == 0)
			sf(8,18,1);
			else if (gf(8,18) == 1)
				sf(8,18,2);
			else if (gf(8,18) == 2) {
				sf(8,18,3);
				activate_hidden_group(1);
				set_level(30001,1);
				set_name(804,"Rokaj Raider");
				set_name(805,"Rokaj Raider");
				set_name(806,"Rokaj Raider");
				set_name(807,"Rokaj Raider");
				change_max_health(30001,-3);
				set_percent_adjust(30001,10,-30);
				set_amount_adjust(30001,0,-2);
					
				talk_no_exit(30);
				}
			else if ((gf(8,18) == 3) && (num_chars_in_group(1) == 0)) {
				sf(8,18,4);
				activate_hidden_group(2);
				run_game_hardcode(4);
				begin_talk_mode(18);
				}
			else if (gf(8,18) == 4)
				sf(8,18,5);
			else if (gf(8,18) == 5)
				sf(8,18,6);
			else if (gf(8,18) == 6) {
				sf(8,18,7);
				talk_no_exit(40);
				}
		}
		
	//if ((set_ter1 == 0) && (gf(0,0) > 0)) {
	//	set_ter1 = 1;
	//	set_terrain(,,,);
	//	}
		
	// if (gf(,) == 0) {
	//if (get_ran(1,0,100) < 10)
	//	give_char_text_bubble(,"");
	//	}

	//if (gf(,) < 2) {
	//	inc_flag(,,1);
	//	if (gf(,) == 2)
	//		begin_talk_mode();
	//	}

	if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_town()) && (tick_difference(last_abil,get_current_tick()) > 0))) {
		if ((gf(8,1) > 0) && (is_talking() == FALSE)) {
			counter1 = counter1 + 1;
			if (counter1 > 10)
				counter1 = 0;
			if (counter1 == 1)
				assert_hint(0);
			}
		if ((gf(8,2) > 0) && (party_has_item(36) == FALSE) && (is_talking() == FALSE)) {
			counter2 = counter2 + 1;
			if (counter2 > 10)
				counter2 = 0;
			if (counter2 == 1)
				assert_hint(1);
			}
		if ((gf(8,2) > 0) && (party_has_item(36)) && (party_has_item_equip(36) == FALSE) && (is_talking() == FALSE) && (gf(88,2) < 2)) {
			sf(88,1,2);
			counter3 = counter3 + 1;
			if (counter3 > 10)
				counter3 = 0;
			if (counter3 == 1)
				assert_hint(2);
			}
		if ((gf(8,14) > 1) && (is_combat())) {
			counter3 = counter3 + 1;
			if (counter3 > 10)
				counter3 = 0;
			if (counter3 == 1)
				assert_hint(4);
			}
		
		last_abil = get_current_tick();
		}
break;

beginstate 10;
	sf(8,19,1);
break;

beginstate 11;
	if (gf(8,21) == 0) {
		sf(8,21,1);
		assert_hint(6);
		}
break;

beginstate 12;
break;

beginstate 13;
break;

//	print_str("");
//	set_terrain_string_range(".",1);
//	set_terrain_string_range("The sign says - .",1);
